package de.baumann.browser.views.dialog

import android.content.Context
import android.widget.Toast
import de.baumann.browser.R
import kotlinx.android.synthetic.main.dialog_comment.*

class ComplaintDialog(context: Context, commentListenber: OnCommentListenber) : CommentDialog(context, commentListenber) {

    override fun initView() {
        edComment.hint = context.getString(R.string.vomit)
        tvPublish.text = context.getString(R.string.app_ok)

        tvPublish.setOnClickListener {
            val content = edComment.text.toString().trim()
            if (content.isEmpty()) {
                Toast.makeText(context, context.getString(R.string.input_content), Toast.LENGTH_SHORT).show()
                return@setOnClickListener
            }
            commentListenber.comment(content)
        }
    }
}
